
export async function loadRes<T> (path:string,clz:any):Promise<T> {
    return new Promise<T>((resolve,reject)=>{
        cc.loader.loadRes(path, clz, (err, res) => {
            if(err){
                return reject(err)
            }
            return resolve(res);
        });
    })
}
export function roll(roll:number,max:number):boolean{
    var rand = Math.random()* max;   
    if(rand<roll){
        return true;
    }
    return false;
}
